<ui:composition template="/templates/layout.xhtml" xmlns="http://www.w3.org/1999/xhtml"
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:f="http://java.sun.com/jsf/core"
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:c="http://java.sun.com/jstl/core"
     xmlns:fmt="http://java.sun.com/jstl/fmt"
     xmlns:x="http://java.sun.com/jstl/xml"
     xmlns:fn="http://java.sun.com/jstl/functions"
     xmlns:a4j="http://richfaces.org/a4j"
     xmlns:rich="http://richfaces.org/rich"
     xmlns:gape="http://componentes.gape/component/gape">
     
	<ui:define name="titulo">
		<h:outputText value="#{msg.applicationName} - #{msg.titleTelaSearchStrategicPerspective}" />
	</ui:define>

	<ui:define name="menu">
		<c:choose>
			<c:when test="${strategy.strategyChosen}">
				<ui:include src="/menu/menuStrategicPlan.xhtml" />					
			</c:when>						
		</c:choose>		
	</ui:define>
	
	<ui:define name="conteudo">
		<h:panelGrid columns="1" columnClasses="FormLinhaBotoes,FormLinhaBotoes">
			<rich:dataTable id="strategicPerspectives" columnClasses="" headerClass="headTable" rowClasses="odd,even"
							value="#{strategicPerspective.listaPerspectiva}" var="row" rows="15">
				<rich:column>
					<f:facet name="header">
						<h:outputText value="#{msg.nameTitleColumn}" />
					</f:facet>
					<h:outputText value="#{row.name}" />
				</rich:column>
				
				<rich:column>
					<f:facet name="header">
						<h:outputText value="#{msg.acronymTitleColumn}" />
					</f:facet>
					<h:outputText value="#{row.acronym}" />
				</rich:column>
				
				<rich:column>
					<f:facet name="header">
						<h:outputText value="#{msg.organizationTitleColumn}" />
					</f:facet>
					<h:outputText value="#{row.nameOrganization}" />
				</rich:column>
				
				<rich:column>
					<h:commandLink action="view" value="#{msg.buttonView}" styleClass="buttonLink">
						<f:setPropertyActionListener value="#{row.name}" target="#{strategicPerspective.name}" />
						<f:setPropertyActionListener value="#{row.description}" target="#{strategicPerspective.description}" />
						<f:setPropertyActionListener value="#{row.id}" target="#{strategicPerspective.id}" />
						<f:setPropertyActionListener value="#{row.acronym}" target="#{strategicPerspective.acronym}" />
						<f:setPropertyActionListener value="#{row.idOrganization}" target="#{strategicPerspective.idOrganization}" />
						<f:setPropertyActionListener value="#{row.nameOrganization}" target="#{strategicPerspective.nameOrganization}" />
						<f:setPropertyActionListener value="#{false}" target="#{strategicPerspective.menuSaveDisabled}" />
					</h:commandLink>
				</rich:column>
				
	 			<f:facet name="footer">
	                <rich:datascroller maxPages="20">
	                </rich:datascroller>
	            </f:facet>
			</rich:dataTable>
		</h:panelGrid>
	</ui:define>	

	<ui:define name="menuTela">
		<ui:include src="menu.xhtml" />
	</ui:define>
	
	<ui:define name="menuNavegacaoBack">
		<gape:navigationBack action="#{strategicPerspective.redirecionaBack}"/>
	</ui:define>
	
	<ui:define name="menuNavegacaoForward">
		<gape:navigationForward action="#" disabled="#{true}"/>
	</ui:define>
</ui:composition>